package com.enterprise.service.impl;

import com.enterprise.dao.ServersManage;
import com.enterprise.dao.ResourcesDao;
import com.enterprise.entity.Resources;
import com.enterprise.entity.Role;
import com.enterprise.entity.page.PageModel;
import com.enterprise.service.ResourcesService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("resourcesService")
public class ResourcesServiceImpl extends ServersManage<Resources, ResourcesDao> implements ResourcesService {

	@Resource(name="resourcesDao")
	@Override
	public void setDao(ResourcesDao resourcesDao) {
		this.dao = resourcesDao;
	}

	@Override
	public List<Resources> getResources(String str) {
		return dao.getResourcesByName(str);
	}

	@Override
	public int toRoleRes(String[] roleIds,String[] resourcesIds) {
		System.out.println(roleIds);
		System.out.println(resourcesIds);
		return 0;
	}

	@Override
	public PageModel selectPowerPageList(Resources resources) {
		return this.dao.selectPowerPageList(resources);
	}
}
